<template>
  <div class="nav-bar">
    
    <van-config-provider :theme-vars="themeVars">
      <van-nav-bar
      
        :title="title"
        left-text=""
        left-arrow
        @click-left="onClickLeft"

      >
      <template #right>
         <slot></slot>
      </template>
       
      </van-nav-bar>
    </van-config-provider>
  </div>
</template>

<script setup>
import { defineProps } from "vue";
import { useRouter } from "vue-router";

const props = defineProps({
  title: String,
  bgColor:String
});
const router = useRouter();
const onClickLeft = () => router.go(-1);
const themeVars = {
  navBarBackgroundColor: props.bgColor||"#ffc400",
};
</script>

<style lang="less" scoped>
</style>